import network from '../network/index'

export default ({
    state: {
      detailsItem:JSON.parse(localStorage.getItem('details')),
    //   message:[]
    },
    mutations: {
        getDetails(state,id){
            network.getDetails({id:id}).then((res)=>{
                localStorage.setItem('details',JSON.stringify(res.data.data))
            }).catch((error)=>{
                console.log(error)
            })
            console.log("详情页数据",state.detailsItem)

        }
    },
    actions: {
        getDetails(context,id){
            context.commit('getDetails',id)
        }
    },
    modules: {

    }
})
  